﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SWENAssignment
{
    public partial class deleteDisplayStaffProfile : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            lblStaffID.Text = (string)Session["staffId"];
            if (!Page.IsPostBack)
            {
                staffDetails s = DBmanager.getByStaffId(lblStaffID.Text);
                lblStaffID.Text = Request.QueryString["staffId"];
                lblStaffID.Text = s.StaffId;
                lblLastName.Text = s.lastName;
                lblFirstName.Text = s.firstName;
                lblNRIC.Text = s.nric;
                lblAddress.Text = s.address;
                lblGender.Text = s.gender;
                lblBankAccType.Text = s.bankAccType;
                lblBankAccNo.Text = s.bankAccNumber;
                lblDutyType.Text = s.dutyType;
            }
        }

        protected void btnDelete_Click(object sender, EventArgs e)
        {
            if (DBmanager.deleteStaffProfile(lblStaffID.Text) == 1)
            {
                Server.Transfer("deleteStaffProfileSuccessfully.aspx?");
            }
        }

        protected void btnBack_Click(object sender, EventArgs e)
        {
            Server.Transfer("deleteStaffProfile1.aspx?");
        }
    }
}